import HomeView from '@/components/views/HomeView.vue'
import NotFound from '@/components/views/NotFound.vue'
import SearchView from '@/components/views/SearchView.vue'
import {createRouter, createWebHashHistory,createWebHistory} from 'vue-router'


const routes = [
  {path: '/home', component:()=>import("@/components/views/HomeView.vue") ,name:'aa'},
  {path: '/search/:key',component:()=>import("@/components/views/SearchView.vue")},
  //重定向
  {path: '/', redirect: '/home'},
  //最后一个
  { path: '/:pathMatch(.*)*', name: 'NotFound', component:()=>import("@/components/views/NotFound.vue") },
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router